const formatTime = date => {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  const hour = date.getHours()
  const minute = date.getMinutes()
  const second = date.getSeconds()

  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}

const formatNumber = n => {
  n = n.toString()
  return n[1] ? n : '0' + n
}

const login = ()=>{
    return  wx.request({
    url: 'http://192.168.6.168/public/account/login.php?mobile=18511430131',
    // data: {
    //   orderNo: 'TZ1522120014342196983687138313021p8l6ko'
    // },
    header: {
      'content-type': 'application/json' // 默认值
    },
    success: function (res) {
      console.log(res.data)
    }
  })
}

module.exports = {
  formatTime: formatTime,
  login: login
}
